/*
 * @Author: 杨三炮
 * @Date: 2021-11-20 13:32:22
 * @LastEditors: 杨三炮
 * @LastEditTime: 2021-11-21 16:42:58
 * @FilePath: \node\node\routers\student.js
 */

const express = require('express')
const router = express()
const student = require('../dao/student_dao')
const passport = require('passport')
router.get('/', (req, res) => res.send('进入student路由根目录'))


//获取所有通知与数量(分页获取)
router.get('/getNotice', passport.authenticate('jwt', { session: false }), (req, res) => {
    student.getNotice(req, res)
})
//获取的我通知已读列表(供已读未读状态渲染)
router.get('/getNoticeRead', passport.authenticate('jwt', { session: false }), (req, res) => {
    student.getNoticeRead(req, res)
}) 
//已读转未读
router.get('/goweidu', passport.authenticate('jwt', { session: false }), (req, res) => {
    student.goweidu(req, res)
})
//未读转已读
router.get('/goyidu', passport.authenticate('jwt', { session: false }), (req, res) => {
    student.goyidu(req, res)
})

//健康填报表
router.post('/sethealth', passport.authenticate('jwt', { session: false }), (req, res) => {
    student.sethealth(req, res)
})
//分页获取当天填报表与总数量
router.get('/gethealthNowDayPage', passport.authenticate('jwt', { session: false }), (req, res) => {
    student.gethealthNowDayPage(req, res)
})
//获取当天某用户报表
router.get('/getHealthNowDayByid', passport.authenticate('jwt', { session: false }), (req, res) => {
    student.getHealthNowDayByid(req, res)
})
//获取当天所有填报表
router.get('/gethealthNowDay', passport.authenticate('jwt', { session: false }), (req, res) => {
    student.gethealthNowDay(req, res)
})
// 获取当月报表
router.get('/gethealthNowMonth', passport.authenticate('jwt', { session: false }), (req, res) => {
    student.gethealthNowMonth(req, res)
})
//  获取所有报表
router.get('/getAllHealth', passport.authenticate('jwt', { session: false }), (req, res) => {
    student.getAllHealth(req, res)
})
//请假申请
router.post('/setLeave', passport.authenticate('jwt', { session: false }), (req, res) => {
    student.setLeave(req, res)
})



module.exports = router